package com.zyj.eps.service;

import com.zyj.eps.mapper.UserMapper;
import com.zyj.eps.pojo.BackHomeApply;
import com.zyj.eps.pojo.Inform;
import com.zyj.eps.pojo.News;
import com.zyj.eps.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author super
 * @date 2022/3/22 20:19
 */
@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserMapper userMapper;
    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public List<User> getAllUser() {
        return userMapper.getAllUser();
    }

    @Override
    public User Login(String uname,String password) {
        return userMapper.Login(uname,password);
    }

    @Override
    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    @Override
    public int register(User user) {
        return userMapper.register(user);
    }

    @Override
    public User getUserByUUID(String UUID) {
        return userMapper.getUserByUUID(UUID);
    }

    @Override
    public int editUserInfo(User user) {
        return userMapper.editUserInfo(user);
    }

    @Override
    public News getNews(int id) {
        return userMapper.getNews(id);
    }

    @Override
    public List<User> getAllUserByHealth() {
        return userMapper.getAllUserByHealth();
    }

    @Override
    public List<Inform> getInformByUserId(int uid) {
        return userMapper.getInformByUserId(uid);
    }

    @Override
    public int addBackHomeApply(BackHomeApply backHomeApply) {
        return userMapper.addBackHomeApply(backHomeApply);
    }
}
